<include file="../Public/header" />


	<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/layout.css" />
 <link href="__PUBLIC__/themes/blue/layout.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/js/tbox/tbox.js" ></script>
<script type="text/javascript" src="__PUBLIC__/js/admin.js" ></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-admin-box.js"></script>
<script>
	// tbox用常量
	var THEME = "__THEME__";
	var APP    = "__APP__";
	var URL    = "__URL__";
	var PUBLIC = "../Public";
	var SITE_URL = "{*SITE_URL}";
</script>

<body>
<div id="container_s">
	<!-- 搜索位 BEGIN -->
	<form  action="{:U('admin/System/feed')}" method="POST">
		<table class="tableborder" width="100%" id="search">
		  <tbody>
			<tr class="top">
			  <td class="border" colspan="2">
			  </td>
			</tr>
			<tr onClick="$('#search .cell').toggle();">
			  <th class="header" colspan="2">筛选条件</th>
			</tr>
			<tr class="label cell">
			  <th>说明</th>
			  <th>条件</th>
			</tr>

			<tr class="cell">
			  <td class="altbg1">
				<b>用户ID</b>
				<br/>
				<span class="smalltxt">搜索指定用户的动态</span>
			  </td>
			  <td class="altbg2">
				<input name="userId" class="txt" value="{$userId}"/> [ 注：多用户时请以英文的“,”分割 ]
			  </td>
			</tr>

			<tr class="cell">
			  <td class="altbg1">
				<b>应用类型</b>
				<br/>
				<span class="smalltxt">只看给定应用的动态</span>
			  </td>
			  <td class="altbg2">
				<select name="appname">
				  <option value = "0" <empty name="appname">selected</empty>>无</option>
				  <volist name="appnames" id="vo">
					<option value="{$vo}" <php>if($vo == $appname) echo 'selected';</php>>{$vo}</option>
				  </volist>
				</select>
			  </td>
			</tr>

			<tr class="cell">
			  <td class="altbg1">
				<b>动态类型</b>
				<br/>
				<span class="smalltxt">只看给定的动态类型</span>
			  </td>
			  <td class="altbg2">
				<select name="type">
				  <option value = "0" <empty name="type">selected</empty>>无</option>
				  <volist name="types" id="vo">
					<option value = "{$vo}" <php>if($vo == $type) echo 'selected';</php>>{$vo}</option>
				  </volist>
				</select>
			  </td>
			</tr>

			<tr class="cell">
			  <td class="altbg1">
				<b>结果集</b>
				<br/>
			  </td>
			  <td class="altbg2">
				id DESC
				<select name="limit">
				  <option value = "20" <eq name="limit" value="20">selected</eq>>每页显示20条</option>
				  <option value = "50" <eq name="limit" value="50">selected</eq>>每页显示50条</option>
				  <option value = "100" <eq name="limit" value="100">selected</eq>>每页显示100条</option>
				</select>
			  </td>
			</tr>

			<tr>
			  <td>&nbsp;</td>
			  <td><input type="submit" class="button mt10 mb10" value="提交" />&nbsp;<input type="button" onClick="location.href='__URL__&act=upFeedCache'" class="button mt10 mb10" value="清空缓存" /></td>
			</tr>
		  </tbody>
		</table>
	</form>
	<!-- 搜索位 END -->
	
	<!-- 正文 BEGIN -->
	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder" id="checkList">
		<tbody>
			<!-- 列表标题 -->
			<tr class="top">
				<td class="border" colspan="10"></td>
			</tr>
			<tr>
				<th class="header" colspan="10"> 动态列表 </th>
			</tr>

			<!-- 列表字段 id,uid,title,appname,type,cTime -->
			<tr class="label cell">
				<th width="20">&nbsp;</th>
				<th width="50">ID</th>
				<th width="100">用户</th>
				<th>标题</th>
				<th width="50">应用</th>
				<th width="50">类型</th>
				<th width="120">创建时间</th>
			</tr>
			
			<!-- 列表数据 -->
			<volist name="data" id='vo'>
			<tr id="list_{$vo.id}" class="cell">
				<td><label><input type="checkbox" class="feed_admin_check" rel="0" dataId="{$vo['id']}"></label></td>
				<td>{$vo.id}</td>
				<td><a href="{:U('space/View/index',array('uid'=>$vo['uid']))}" target="_blank">{$vo.uid|getUserName}</a></td>
				<td>{$vo.title}</td>
				<td>{$vo.appname}</td>
				<td>{$vo.type}</td>
				<td>{$vo.cTime|date="Y-m-d H:i:s",###}</td>
			</tr>
			</volist>

			<tr>
				<td class="footer" colspan="10">
					<!--
					<button type="button" onclick="checkall('checkList',true)">全选</button>
					<button type="button" onclick="checkall('checkList',false)">全不选</button>
					<button type="button" onclick="javascript:del('0','__URL__&act=deleteAsk')">删除</button>
					-->
				</td>
			</tr>

			<tr class="bottom">
				<td class="border" colspan="10"><div class="page mt5 alR mb20" style="float:right;">{$html}</div></td>
			</tr>

		</tbody>
	</table>
	<!-- 正文 END -->
</div>

<!-- 前台管理 BEGIN -->
<div id="feed_admin" style="display:none;">
	<a href="javascript:void(0)" onClick="deleteFeed()">删除动态</a>
</div>
<!-- 前台管理 END -->

<!-- 页面JS BEGIN -->
<script type="text/javascript">
	//加载前台管理工具
	$(function(){
		$.fn.admin({
			prefix:'feed_',
			checkClass:'feed_admin_check',
			hiddenId:'feed_admin',
			lMinOffset:1,
			type:false,
			position:'right'
		});
	});

	//删除附件至回收站
	function deleteFeed() {
		if(confirm('确认要将所选附件删除至回收站吗？')){
			$.post("{:U('admin/System/doDeleteFeed')}", {id:$.fn.getData('feed_')}, function(result){
				if(result == 1) {
					$.tbox.yes('删除成功',"提示");
					setTimeout("$.tbox.close()",1500);
					$.each($.fn.getData('feed_'),function(i,n){
						$("#list_"+n).remove();
					});
					$('#feed_admin_box').hide();
				}else{
					$.tbox.no('删除失败',"提示");
					setTimeout("$.tbox.close()",1500);
				}
			});
		}
	}
</script>
<!-- 页面JS END -->

</body>
</html>
